import Pyro4
import time
import threading
def main():
    server_uri = 'PYRO:billserver.damarnet@127.0.0.1:2012'
    billserver = Pyro4.Proxy(server_uri)
    client_id = 'PC1'
    billserver.login(client_id)
    while True:
        time.sleep(2)
        try:
            billdata = billserver.get_bill_data(client_id)
            print billdata
        except:
            billserver.logout(client_id)
            exit
        

if __name__=="__main__":
  main()